package day05;
import java.util.Arrays;
//数据的演示
public class ArrayDemo {
    public static void main(String[] args) {
        int[] arr = new int[10];
        for (int i = 0;i<arr.length;i++){
            arr[i] = (int) (Math.random()*100);
            System.out.println(arr[i]);

        }

        Arrays.sort(arr);

        System.out.println("排序后：");
        for (int i =0;i<arr.length;i++){
            System.out.println(arr[i]);
        }

        System.out.println("倒着排序");
        for (int i = arr.length-1;i>=0;i--){
            System.out.println(arr[i]);
        }














        /*
        int[] arr = new int[10];
        for (int i=0;i<arr.length;i++){
            arr[i] = (int) (Math.random()*100);
            System.out.println(arr[i]);
        }

         */







        /*
        int [] a = new int[5];
        double [] b = new double[10];
        boolean [] c = new  boolean[20];

        int[] a1 = new int[5];
        double[] b2 = new double[10];
        boolean[] c2 = new boolean[20];


        int[] arr1 = new int[3];
        int[] arr2 = {2,5,8};
        int[] arr3 = new int[]{2,5,8};
        int[] arr4;
        arr4 = new int[]{2,5,8};

        int[] arr = new  int[3];
        System.out.println("数组的长度"+arr.length);
        System.out.println(arr[0]);
        arr[0] = 100;
        arr[1] = 200;
        arr[2] = 300;
        System.out.println(arr[arr.length-1]);




        int[] arr5 = new int[3];
        System.out.println("数组的长度"+arr5.length);
        System.out.println(arr5[0]);
        arr5[0] = 100;
        arr5[1] = 200;
        arr5[2] = 300;
        System.out.println(arr5[arr5.length-1]);

         */



    }
}
